-
Notifications
You must be signed in to change notification settings - Fork 0
테스트 코드 계산기 프로젝트 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
테스트 코드 계산기 프로젝트 #17
Conversation
Yeonnies
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
솔직히 코드 너무 훌륭한데요
DI 컨테이너까지 사용하실 줄 몰랐고 MVVM 분리가 명확했고 네이밍도 명확하네요
진짜 배워갑니다.. 엄청 성장하신거 같아요..
--편지--
원래부터 잘하는 줄은 알고 있었지만 진짜 잘하네..
사실 첨에 태도가 좀 맘에 안들었는데 피드백 듣고 항상 열심히 해줘서 고맙다!
스매싱 가서도 열심히 하거라~ 스유로 하니까 걍 날라다니네
|
|
||
| import Foundation | ||
|
|
||
| final class AppDIContainer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이걸 썻네
| HStack(spacing: 12) { | ||
| ForEach(row, id: \.self) { button in | ||
| CalculatorButtonView(button: button) { | ||
| viewModel.buttonPressed(button) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 이거 뎁스 너무 깊지 않나요.. 저는 이런 경우 익스텐션에 뷰를 만들거덩여.. 물론 코드 스타일이니 갠취지만 훨씬 가독성이 좋아집니다
작업 내용
TDD 방식으로 iOS 계산기 앱을 구현했습니다. SwiftUI와 MVVM 아키텍처를 사용했고, 테스트 가능한 코드를 위해 의존성 주입 패턴을 적용했습니다.
구현 기능
기본 기능
핵심 기능: 연속 계산
일반 계산기처럼 연속으로 계산이 가능합니다.
예시: 24 + 36 + 20 = 80
아키텍처
MVVM 패턴으로 View, ViewModel, Model을 분리했습니다.
의존성 주입
프로토콜을 사용해서 ViewModel이 Calculator를 주입받도록 했습니다.